package com.ruitu.health_2.ui.adapter;

import android.content.Context;
import android.widget.TextView;

import com.makeramen.roundedimageview.RoundedImageView;
import com.ruitu.arad.base.base_list.ListBaseAdapter;
import com.ruitu.arad.base.base_list.SuperViewHolder;
import com.ruitu.health_2.R;
import com.ruitu.router_module.bean.product.Book;
import com.ruitu.router_module.util.GlideUtil;

public class ModelBookListAdpter extends ListBaseAdapter<Book> {
    public ModelBookListAdpter(Context context) {
        super(context);
    }

    @Override
    public int getLayoutId() {
        return R.layout.item_common_book_list;
    }

    @Override
    public void onBindItemHolder(SuperViewHolder holder, int position) {
        RoundedImageView icon = holder.getView(R.id.icon);
        TextView tv_title = holder.getView(R.id.tv_title);
        TextView tv_name = holder.getView(R.id.tv_name);
        TextView tv_subtitle = holder.getView(R.id.tv_subtitle);

        Book book = mDataList.get(position);
        tv_title.setText(book.getBookName());
        tv_name.setText(book.getArtManName());
        tv_subtitle.setText(book.getReadPartyName());

        GlideUtil.loadImg(book.getBookCover(), icon);
    }
}
